package com.wbq.datastructuredemo.activity;

import com.wbq.datastructuredemo.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;

public class LoginActivity extends Activity implements OnClickListener{
	private static final String TAG ="LoginActivity";
	private RelativeLayout longin_div;
	private Button bt_login_ok;
	private Button bt_login_register;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
		this.longin_div = (RelativeLayout) super.findViewById(R.id.login_div);
		int screenHeight = getWindowManager().getDefaultDisplay().getHeight();
		Log.i(TAG, ""+screenHeight);
		LayoutParams layoutParams=(LayoutParams) this.longin_div.getLayoutParams();
		layoutParams.topMargin=screenHeight/7;
		this.longin_div.setLayoutParams(layoutParams);
		bt_login_ok = (Button) super.findViewById(R.id.bt_login_ok);
		bt_login_ok.setOnClickListener(this);
	}
	@Override
	public void onClick(View v) {
		loadMainUI();
	}
	
	/**
	 * 页面跳转
	 */
	private void loadMainUI(){
		Intent intent = new Intent(LoginActivity.this,MainActivity.class);
		startActivity(intent);
		finish();//把当前的activity从任务栈里面移除
	}

}
